package com.coscon.controller;

import com.coscon.controller.base.BaseController;
import com.coscon.enums.PlayerToolSoftEnum;
import com.coscon.model.ProcessInformations;
import org.apache.commons.lang3.SystemUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;


/**
 *music控制
 */
@Controller
@RequestMapping("/jm/manager/music")
public class MusicController extends BaseController {


    @GetMapping("/index")
    public ModelAndView welcomePage(HttpServletRequest request){
        ModelAndView v = new ModelAndView("appPage/musicOper");
        v.addObject("IS_MAC_OS", SystemUtils.IS_OS_MAC);//是否是MAC系统
        v.addObject("IS_WIN_OS", SystemUtils.IS_OS_WINDOWS);//是否是WIN系统
        if(SystemUtils.IS_OS_MAC){
            boolean vlcIsRun =  ProcessInformations.processIsRun(PlayerToolSoftEnum.VLC_MAC);
            boolean xlPlayerIsRun =  ProcessInformations.processIsRun(PlayerToolSoftEnum.XLPlayer_MAC);
            v.addObject("vlcIsRun", vlcIsRun);
            v.addObject("xLPlayerIsRun", xlPlayerIsRun);
        }
        return v;
    }
    

}
